package cn.itcast.springmvc.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import cn.itcast.springmvc.pojo.User;

@RequestMapping("hello3")
@RestController
public class Hello3Controller {

	@RequestMapping(value="show28")
	public List<User> test28(){
		List<User> userList = new ArrayList<>();
		for(int i=0; i<20; i++){
			User user = new User();
			user.setAge(16+i);
			user.setName("大黄");
			user.setUserName("bigYellow");
			user.setId(i+1l);
			userList.add(user);
		}
		return userList;
	}
	
	@RequestMapping(value="show18")
	public String test18(Model model){
		model.addAttribute("msg", "springmvc特有的内置对象");
		return "hello";
	}
}
